@page
{{~ if !Option.SkipPermissions ~}}
@using {{ ProjectInfo.FullName }}.Permissions
{{~ end ~}}
{{~ if Bag.PagesFolder; pagesNamespace = Bag.PagesFolder + "."; end ~}}
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using {{ ProjectInfo.FullName }}.Web.Pages.{{ pagesNamespace }}{{ EntityInfo.RelativeNamespace }}.{{ EntityInfo.Name }}
@using {{ ProjectInfo.FullName }}.Localization
@using {{ ProjectInfo.FullName }}.Web.Menus
@model IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<{{ ProjectInfo.Name }}Resource> L
{{~ if !Option.SkipPermissions ~}}
@inject IAuthorizationService Authorization
{{~ end ~}}
{{~ if Bag.PagesFolder; pagesFolder = Bag.PagesFolder + "/"; end ~}}
@{
    PageLayout.Content.Title = L["{{ EntityInfo.Name }}"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:{{ EntityInfo.Name }}"].Value);
    PageLayout.Content.MenuItemName = {{ ProjectInfo.Name }}Menus.{{ EntityInfo.Name }};
}

@section scripts
{
    <abp-script src="/Pages/{{ pagesFolder }}{{ EntityInfo.RelativeDirectory }}/{{ EntityInfo.Name }}/index.js" />
}
@section styles
{
    <abp-style src="/Pages/{{ pagesFolder }}{{ EntityInfo.RelativeDirectory }}/{{ EntityInfo.Name }}/index.css"/>
}
@section content_toolbar
{
{{~ if !Option.SkipPermissions ~}}
	@if (await Authorization.IsGrantedAsync({{ ProjectInfo.Name }}Permissions.{{ EntityInfo.Name }}.Create))
    {
{{~ end ~}}
        <abp-button id="New{{ EntityInfo.Name }}Button"
            text="@L["Create{{ EntityInfo.Name }}"].Value"
            icon="plus" size="Small"
            button-type="Primary" />
{{~ if !Option.SkipPermissions ~}}
    }
{{~ end ~}}
}

<abp-card>
    <abp-card-body>
        {{~ if !Option.SkipGetListInputDto ~}}
        <abp-row class="mb-3">
            <a abp-collapse-id="{{ EntityInfo.Name }}Collapse" class="text-secondary">@L["TableFilter"] </a>
        </abp-row>
        {{~ end ~}}
        {{~ if !Option.SkipGetListInputDto ~}}
        <abp-dynamic-form abp-model="{{ EntityInfo.Name }}Filter" id="{{ EntityInfo.Name }}Filter" required-symbols="false" column-size="_3">
            <abp-collapse-body id="{{ EntityInfo.Name }}Collapse">
                <abp-form-content />
            </abp-collapse-body>
        </abp-dynamic-form>
        <hr />
        {{~ end ~}}
        <abp-table striped-rows="true" id="{{ EntityInfo.Name }}Table" class="nowrap"/>
    </abp-card-body>
</abp-card>
